package org.openslash;

import org.openslash.util.AbstractDebug;

import android.os.Handler;
import android.os.Message;

public class adebug extends AbstractDebug {

	private Handler msgHandler;
	private StringBuffer buf;
	public adebug(Handler handler)
	{
		msgHandler = handler;
		buf = new StringBuffer();
	}
	
	public void _line()
	{
		Message m = msgHandler.obtainMessage();
		buf.append('\n');
		m.obj = buf.toString();
		msgHandler.sendMessage(m);
		buf.delete(0, buf.length());
	}

	public void _line(Object obj)
	{
		Message m = msgHandler.obtainMessage();
		buf.append(String.valueOf(obj)).append('\n');
		m.obj = buf.toString();
		msgHandler.sendMessage(m);
		buf.delete(0, buf.length());
	}

	public void _tab(Object obj)
	{
		buf.append(String.valueOf(obj)).append(' ');
	}
}
